home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / minicomp.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  1.3 KB  |  38 lines

  1. //----------------------------------------------------------------------------
  2. //Borland C++Builder
  3. //Copyright (c) 1987, 1998 Borland International Inc. All Rights Reserved.
  4. //----------------------------------------------------------------------------
  5. //-------------------------------------------------------------------------
  6. //    minicomp.cpp - uses the TCounter example component
  7. //-------------------------------------------------------------------------
  8. #include "minicomp.h"
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <condefs.h>
  12. //-------------------------------------------------------------------------
  13. USEUNIT("counter.cpp");
  14. //---------------------------------------------------------------------------
  15. main()
  16. {
  17.   TExample example;
  18.  
  19.   return 0;
  20. }
  21. //-------------------------------------------------------------------------
  22. TExample::TExample()
  23. {
  24.   TCounter Counter(7);
  25.   int i;
  26.  
  27.   Counter.OnMultiple = MultipleReached;
  28.  
  29.   for (i=0; i < 100; i++)
  30.     Counter.Increment();
  31. }
  32. //-------------------------------------------------------------------------
  33. void TExample::MultipleReached(TCounter *Sender)
  34. {
  35.   printf("Multiple=%d reached with val=%d\n", Sender->Multiple, Sender->Val);
  36. }
  37. //-------------------------------------------------------------------------
  38.